package com.gezi.admin.module.code.tmpl;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gezi.admin.module.code.tmpl.model.CodeTmplAddParamModel;
import com.gezi.admin.module.config.BaseEntity;
import com.gezi.admin.utils.excel.ExcelColumn;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author 格子代码
 * @createDate 2024/2/10 09:00
 * @contact 1424529270@qq.com
 */
@Data
@TableName("code_tmpl")
public class CodeTmplEntity extends BaseEntity {

    @ExcelColumn(name = "文本普通")
    @ApiModelProperty(value = "文本普通")
    @TableField(value = "text_putong")
    private String textPutong;

    @ExcelColumn(name = "文本长文")
    @ApiModelProperty(value = "文本长文")
    @TableField(value = "text_long")
    private String textLong;

    @ExcelColumn(name = "文本JSON")
    @ApiModelProperty(value = "文本JSON")
    @TableField(value = "text_json")
    private String textJson;

    @ExcelColumn(name = "文本复制")
    @ApiModelProperty(value = "文本复制")
    @TableField(value = "text_copy")
    private String textCopy;

    @ExcelColumn(name = "文件单个")
    @ApiModelProperty(value = "文件单个")
    @TableField(value = "file_url")
    private String fileUrl;

    @ExcelColumn(name = "文件多个")
    @ApiModelProperty(value = "文件多个")
    @TableField(value = "file_urls")
    private String fileUrls;

    @ExcelColumn(name = "状态开关")
    @ApiModelProperty(value = "状态开关")
    @TableField(value = "state_switch")
    private Boolean stateSwitch;

    @ExcelColumn(name = "选择单选")
    @ApiModelProperty(value = "选择单选")
    @TableField(value = "select_one")
    private String selectOne;

    @ExcelColumn(name = "选择多选")
    @ApiModelProperty(value = "选择多选")
    @TableField(value = "select_more")
    private String selectMore;

    @ExcelColumn(name = "富文本")
    @ApiModelProperty(value = "富文本")
    @TableField(value = "fuwenben")
    private String fuwenben;

    public void setData(CodeTmplAddParamModel paramModel) {
        this.textPutong = paramModel.getTextPutong();
        this.fileUrl = paramModel.getFileUrl();
        this.fileUrls = paramModel.getFileUrls();
        this.textLong = paramModel.getTextLong();
        this.stateSwitch = paramModel.getStateSwitch();
        this.textJson = paramModel.getTextJson();
        this.selectOne = paramModel.getSelectOne();
        this.selectMore = paramModel.getSelectMore();
        this.fuwenben = paramModel.getFuwenben();
        this.textCopy = paramModel.getTextCopy();
    }
}